package com.zgr.newhospital.service;

import com.zgr.newhospital.entity.User;
import com.zgr.newhospital.mapper.UserMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @Author: 郑国荣
 * @Date: 2023-07-20-11:40
 * @Description:
 */

@Service
@Component
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUserByID(int uid) {
        return userMapper.selectById(uid);
    }

    @Override
    public int addUser(User user) {
        if (userMapper.insert(user)==1) return 1;
        else return 0;
    }
}
